<?php

header('Content-Type:application/json');//这个类型声明非常关键
header('Access-Control-Allow-Origin: *');//避免跨域

$array = [
    'status'  => 0,
    'message' => [
        [
            "id"    => 1,
            "title" => '家居生活',
        ],
        [
            "id"    => 2,
            "title" => '摄影',
        ],
        [
            "id"    => 3,
            "title" => 'IT',
        ],
        [
            "id"    => 4,
            "title" => '数码',
        ],
        [
            "id"    => 5,
            "title" => '建材',
        ],
        [
            "id"    => 6,
            "title" => '电视',
        ],
        [
            "id"    => 7,
            "title" => '空间设计',
        ],
        [
            "id"    => 8,
            "title" => '花式扣篮',
        ],
        [
            "id"    => 9,
            "title" => '户型装饰',
        ],
    ]
];
echo json_encode($array);